﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using L = Science.Mathematics.LinearAlgebra;

namespace Strang3Ed.Chapter02.Section6
{
    public class ExampleB
    {
        public ExampleB()
        {
        }
        private string result;
        public string Result
        {
            get { return result; }
        }
        public void Compute()
        {
            double[,] x = {{1.0,1.0,1.0,1.0},                           
                           {1.0,2.0,3.0,4.0},
                           {1.0,3.0,6.0,10.0},
                           {1.0,4.0,10.0,20.0}};

            L.Matrix A = new L.Matrix(x);

            L.FactorizationEAeqR obj = new L.FactorizationEAeqR(A);
            obj.Compute();

            L.Matrix E = obj.Elimination;

            result += E.ToString();

            L.Matrix F = obj.ReducedRowEchelonForm;

            result += F.ToString();
        }
    }
}
/*
4     -6.00000000000001     4.00000000000001     -1     
-6.00000000000001     14     -11     3.00000000000001     
4     -11     10     -3     
-1     3     -3     1     

1     -8.88178419700125E-16     -1.77635683940025E-15     -7.105427357601E-15     
8.88178419700125E-16     1     7.105427357601E-15     2.8421709430404E-14     
-4.44089209850063E-16     -1.77635683940025E-15     1     -7.105427357601E-15     
2.22044604925031E-16     1.77635683940025E-15     3.5527136788005E-15     1     
*/


